define(["jquery", "easy-admin","xm-select"], function ($, ea) {


    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'mall.seller/index',
        export_url: 'mall.seller/export',
    };

    var Controller = {
        index: function () {
            ea.table.render({
                init: init,
                height:'full-50',
                toolbar: ['refresh',
                    [],
                    'export'],
                done: function(res, curr, count){
                    //如果是异步请求数据方式，res即为你接口返回的信息。
                    //如果是直接赋值的方式，res即为：{data: [], count: 99} data为当前页数据、count为数据总长度
                    console.log(res);
                    $("#totalprice").html(res.totalprice);
                    $("#totallirun").html(res.totallirun);
                    $("#totalcostprice").html(res.totalcostprice);
                    $("#refundprice").html(res.refundprice);
                },
                cols: [[
                    {type: "checkbox"},
                    {field: 'id', width: 80, title: 'ID'},
                    {field: 'goods_title', minWidth: 80, title: '商品名称'},
                    {field: 'cost_price', width: 100, title: '成本价'},
                    {field: 'goods_num', width: 100, title: '单笔销量'},
                    {field: 'payprice', width: 100, title: '实付金额', templet: ea.table.price,search: false},
                    {field: 'status', width: 100, search: 'select', selectList: {"0":"待付款","1":"待核销","2":"已核销","3":"过期未核销","4":"取消订单","5":"已退款"}, title: '状态'},
                    {field: 'create_time', minWidth: 80, title: '创建时间', search: 'range'},
                ]],
            });

            ea.listen();
        },

    };
    return Controller;
});